/*
 ========================================================================
 Name        : StopWatchAppUi.cpp
 Author      : Vasily Nemkov
 Copyright   : 
 Description : 
 ========================================================================
 */
#include <eikmenub.h>
#include <akncontext.h>
#include <akntitle.h>
#include <StopWatch_2005B914.rsg>

#include "StopWatchAppUi.h"
#include "StopWatch.hrh"
#include "StopWatchView.h"

CStopWatchAppUi::CStopWatchAppUi()
{
}

CStopWatchAppUi::~CStopWatchAppUi()
{
}

void CStopWatchAppUi::InitializeViewsL()
{
  iStopWatchView = CStopWatchView::NewL();
  AddViewL(iStopWatchView);
  SetDefaultViewL(*iStopWatchView);
}

void CStopWatchAppUi::HandleCommandL(TInt aCommand)
{
  TBool commandHandled = EFalse;
  if (!commandHandled)
  {
    if (aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit)
    {
      Exit();
    }
  }
}

void CStopWatchAppUi::HandleResourceChangeL(TInt aType)
{
  CAknViewAppUi::HandleResourceChangeL(aType);
}

TKeyResponse CStopWatchAppUi::HandleKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
{
  return EKeyWasNotConsumed;
}

void CStopWatchAppUi::HandleViewDeactivation(const TVwsViewId& aViewIdToBeDeactivated, const TVwsViewId& aNewlyActivatedViewId)
{
  CAknViewAppUi::HandleViewDeactivation(aViewIdToBeDeactivated, aNewlyActivatedViewId);
}

void CStopWatchAppUi::ConstructL()
{
  BaseConstructL(EAknEnableSkin | EAknEnableMSK);
  InitializeViewsL();
}

